package utils.error;

public enum EmBusinessError implements CommonError{
    //通用错误类型异常
    PARAMETER_VALIDATION_ERROR(100001,"参数不合法"),
    PARAMETER_INSERT_ERROR(100002,"插入失败"),
    PARAMETER_UPDATE_ERROR(100003,"更新失败"),
    PARAMETER_SELECT_ERROR(100004,"查询失败"),
    PARAMETER_DELETE_ERROR(100005,"删除失败"),
    PARAMETER_INDEX_ERROR(100006,"查询数据为空"),
    UNKNOWN_ERROR(100002,"未知错误"),
    //用户信息错误异常
    USER_NOT_EXIST(20001,"用户不存在"),
    USER_NOT_INSERT(20002,"用户插入失败"),
    USER_NOT_UPDATE(20003,"更新失败"),
    USER_NOT_SELECT(20004,"用户列表查询失败"),
    //token错误异常
    TOKEN_VERIFY_ERROR(30001,"token验证失败"),
    TOKEN_ANALYSIS_ERROR(30002,"token解析失败"),
    //权限验证错误异常

    ROLE_VERIFY_ERROR(40001,"数据库权限未配置"),
    ROLE_DEFICIENCY_ERROR(40002,"权限不足"),
    ROLE_IDMUST_ERROR(40003,"权限未有该接口权限"),
    ROLE_NOTCONFIG_ERROR(40004,"接口未配置权限"),
    ROLE_NOTURL_ERROR(40005,"接口url未配置")
    ;

    private  int errCode;
    private String errMsg;

    EmBusinessError(int errCode, String errMsg) {
        this.errCode=errCode;
        this.errMsg=errMsg;
    }


    @Override
    public int getErrcode() {
        return this.errCode;
    }

    @Override
    public String getErrMsg() {
        return this.errMsg;
    }

    @Override
    public CommonError setErrMsg(String errMsg) {
        this.errMsg = errMsg;
        return this;
    }
}
